/* eslint-disable */
// @ts-ignore
import request from '@/http/vue-query';
import { CustomRequestOptions_ } from '@/http/types';

import * as API from './types';

/** 用户登录 用户登录 POST /login */
export function loginUsingPost({
  body,
  options,
}: {
  body: API.LoginDTO;
  options?: CustomRequestOptions_;
}) {
  return request<API.ResultLoginVO>('/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 修改密码 修改用户密码 PUT /modifyPwd */
export function modifyPwdUsingPut({
  body,
  options,
}: {
  body: API.ModifyPwdDTO;
  options?: CustomRequestOptions_;
}) {
  return request<API.Result>('/modifyPwd', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 刷新token 用refreshtoken换取新的token PUT /refreshToken */
export function refreshTokenUsingPut({
  options,
}: {
  options?: CustomRequestOptions_;
}) {
  return request<API.Result>('/refreshToken', {
    method: 'PUT',
    ...(options || {}),
  });
}

/** 用户注册 用户注册 POST /register */
export function registerUsingPost({
  body,
  options,
}: {
  body: API.RegisterDTO;
  options?: CustomRequestOptions_;
}) {
  return request<API.ResultLong>('/register', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
